/**
 * 
 */
package swingPractice;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * @author p@!
 *
 */
public class GameFileManager {

	private String fileName;
	private String status;

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	public String createFile(){
		return null;
	}
	
	public String readFile(){
		return null;
	}
	
	public String writeFile(){
		return null;
	}
	
	public String appendFile(){
		return null;
	}
	
	public String deleteFile(){
		return null;
	}
	
	
	public void loadSavedGame(String loadFileName) {
		String directory = "GameSave";
		String loadFilePath = directory+"/"+loadFileName;
		File file = new File(loadFilePath);
//		add a try catchy block ----:> fnf error
		try{
			Scanner loadScanner = new Scanner(file);
			while(loadScanner.hasNext()){
				for(int y=0; y<PanelPractice.room.block.length; y++){
					for(int x=0; x<PanelPractice.room.block[0].length; x++){
						PanelPractice.room.block[y][x].createId = loadScanner.nextInt();
					}	
				}
			}
			
			loadScanner.close();
			
		}catch(FileNotFoundException fnf){
			System.out.println("FNF");
			fnf.printStackTrace();
		}catch(Exception exp){
			exp.printStackTrace();
		}
		
		
		 
	}

/*	public static void main(String[] args) {

	}
*/
}
